home *** CD-ROM | disk | FTP | other *** search
/ Larry Magid's Essential Internet / Larry Magid's Essential Internet (Quarterdeck Corporation)(1995).ISO / qsockpro.qip / AIS.MPS < prev    next >
Text File  |  1995-10-09  |  2KB  |  82 lines

  1. # American Information Systems, Inc PPP and SLIP login script
  2. # Copyright 1995 Quarterdeck Corporation
  3. # 5-9-95 BPD
  4.  
  5. #define the variables we will need
  6.  
  7. STRING username
  8. STRING password
  9. STRING framing
  10. STRING IPAddress
  11.  
  12. # uncomment for debugging
  13. # TRACE ON  
  14.  
  15. # reset maximum login timeout. 
  16. SetTimeout      60             
  17.  
  18. # Get username from access method
  19. CfgGetValue "Username" username
  20.  
  21. # if the Username field is empty, prompt the user for it.
  22. IF result = 0 THEN
  23.     GetInput "Enter your user name" username
  24.     IF result = 0 THEN
  25.         PRINT "Warning, no username entered"
  26.     ELSE
  27.         PRINT "Username set to ["; username; "]"
  28.     ENDIF
  29. ENDIF
  30.  
  31. # get password from access method
  32. CfgGetValue "Password" password
  33.  
  34. # if the Password field is empty, prompt the user for it.
  35. IF result = 0 THEN
  36.     GetPassword "Enter your password" password
  37.     IF result = 0 THEN
  38.         PRINT "Warning, no password entered"
  39.     ELSE
  40.         PRINT "Password set."
  41.     ENDIF
  42. ENDIF
  43.  
  44. # get framing layer (MPPPP, MPSLIP)
  45. # abort with an error if we can't read the Framing setting
  46. CfgGetValue "Framing" framing
  47. IF result = 0 THEN
  48.     Abort "Can't read 'Framing' setting from qdeck.ini"
  49. ENDIF
  50.  
  51. CommWaitFor "Number:"           # wait for SLIP/PPP selection
  52.  
  53. # The character before the user name indicates the type of connection.
  54. IF framing = "MPPPP" THEN
  55.     CommSend "5"
  56. ENDIF
  57. IF framing = "MPSLIP" THEN
  58.     CommSend "4"
  59. ENDIF
  60.  
  61. CommSend    "%r"                # send carriage return
  62.  
  63. CommWaitFor "Username:"         # wait for username prompt
  64.     CommSend username           # send user name
  65.     CommSend "%r"               # send carriage return
  66.  
  67. CommWaitFor "Password:"         # wait for password prompt
  68.     CommSend password           # send password
  69.     CommSend "%r"               # send carriage return
  70.  
  71. IF framing = "MPSLIP" THEN
  72.     CommWaitFor "our address is "
  73.     CommReadIPAddr IPAddress
  74.     IF result>0 THEN
  75.         CfgSetValue "IPAddress" IPAddress
  76.         PRINT "%rIP Address set to ["; IPAddress; "]"
  77.     ENDIF
  78. ENDIF
  79.  
  80. END                             # indicate success if we got this far
  81.  
  82.